package com.yeswater.multithread.chapter1.test1_11.test6;

import java.util.concurrent.TimeUnit;

/**
 * author : yeswater
 * date : 2023/10/19
 */

public class MyThread1 extends Thread{

    @Override
    public void run() {
        // try {
            // TimeUnit.SECONDS.sleep(2);
            int i = 100;
            System.out.println("begin");
            if (i == 100) {
                this.stop();
            }
            System.out.println("  end");
        // } catch (InterruptedException e) {
        //     System.out.println(" 先停止,再遇到 sleep! 进入 catch!");
        //     e.printStackTrace();
        // }
    }
}
